<template>
    <!-- 订单详情对话框 -->
    <el-dialog title="订单商品详情" v-model="dialogTableVisible" :visible.sync="dialogTableVisible" width="40%"
        @close="handleClose">
        <el-table :data="orderData" stripe style="width:100%">
            <el-table-column type="index" width="50px">
            </el-table-column>
            <el-table-column prop="goodsPic" label="商品图片">
                <template slot-scope="{row,$index}">
                    <img :src="row.logoUrl" alt="" style="width: 80;height: 80;" />
                </template> 
            </el-table-column>
            <el-table-column prop="goodsName" label="商品名称" width="100">
            </el-table-column>
            <el-table-column prop="goodsPrice" label="商品价格" width="100">
            </el-table-column>
            <el-table-column prop="goodsAmount" label="商品数量" width="100">
            </el-table-column>
        </el-table>
    </el-dialog>
</template>

<script>
export default {
    name: 'dialog',
    data() {
        return {
            orderData: [],
        }
    },
    props: ['dialogTableVisible', 'id'],
    watch: {
        id(val) {
            // console.log("id=" + props.id);
            if (val != -1) {
                getOrderDetail(val)
            }
        }
    },
    methods: {
        handleClose() {
            this.$emit('click')
        },
        // 获取订单详情信息
        async getOrderDetail() {
            let result = await this.$API.order.reqOrderDetail(id)
            if (result.code !== 0) {
                this.orderData = result.data.list;
            }
        }
    }
}

</script>

<style lang="scss" scoped></style>
